package com.qcby.admin.dao;

import com.qcby.admin.model.SysMenu;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * <p>
 * 菜单权限表 Mapper 接口
 * </p>
 *
 * @author admin
 * @since 2024-09-19
 */
public interface SysMenuMapper extends BaseMapper<SysMenu> {

    List<String> selectPermsByUserId(Long userId);

    List<SysMenu> selectAllRouterMenu();

    List<SysMenu> selectRouterMenuTreeByUserId(Long userId);
    List<Long> selectMenuListByRoleId(Long roleId);

    @Select("select menu_id from sys_role_menu rm,sys_role r where r.id=rm.role_id and role_id=#{roleId}")
    List<Long> findCheckedKeyByRoleId(Long roleId);
}
